package com.kl.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118621175";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCE4dlGwaYKhXmwlsRSvCUzJOih9rZUJV3KNqoqTeYhqqGCmSXKQ0V6cieA5iKajTZwErUnADyEsIvJLh4/C1pow6QCZ0YEb8eTSEpJKav4+oHLs4j/YmWW6+zeAf1LWlIiVK1Anac7Pn9eb3tjj583TmXN5vjxBt029zWPTBQ4HrmV3HoIr7GwsCTW95sKYXgtNpsn1EeFC2C3+KfN9oTEZYpWvoOkwZo7HYcs93dVXvWmpb2cduWwU4V9PIOU4ijUuE+pH8wUBuftzxikBi0WeCzHTnq5xYr7JXMkYW+NfMDjoLAvw/sRjg6sksrb70lOU8ZHciDeVF2If2NA0v/9AgMBAAECggEAZY9cCfktV3NGW5IPgJBt+hXmewtdtRhOA6QeEHEzR13rTS6RtHIP4xLmYF0D642sIqIZtDI5Ds0EOYG2+kZKFjIY4wFdgTyRk1638A0adBO6Kh8QwOfKbzvn8JIirnnctoJzXCRiUSRmIp4f9yso7BNOOb2jXEv7vOvaEqh5951gg3EYqciQ+LO7ewmiRJNiGBDQBuTQpAodjPeS9vPQE31Y0vPkAqI9ihIYaNGBd7WQZdEtH4+kVwtZy8G7lM68jAiV84dlNEkk5dEPPv+wBoFNadINT60ABkVWkhk+fe9oSwqIu3uHtP3Zppt7UXKBiXxEzvFiOOSs4spaWbEy4QKBgQDNEVaFLvQr8ERhHHqj/FJecQAvirKM67MZAwOCqXUdQtdOYL9mYj34Zi5My2po96xb/cgnJA8FFyi2YqHgGw6EcTmm/16yqUSo7BaIzA4ZAxsoP5PgbsWvVPK24+FywXkL23HdfuWSG3uOAUC/du9wm2RYYSvVcu4XjCOshgYyuQKBgQCl4su9fBbhkAHDdXHCqXfN3d5MNsLc2l9CMmdwyAEgKVQ77cENg/vLMAco8r3wwJk7+Y8F9f34P4DM/hkMxzWTUHYJbV9QUemzi7SPSpYkp4gndRzVZZcCZhCR3XD+g2Y3+JM5BXPwT4KeAOL0TcgOUpXlHtYB2g5h36ONSk5lZQKBgQCEIgvRvTNvrF0jBaqwR0D7wWwRNhleW/EGyL5WTsI7nHoG8qfhXKP5jj1/FgL2p7/Tdm6lacKT0RxWiK8tK8Hq7NntFNb7371x6s2KT5E15J53DKBIGJggJWhPF/6IZsmMLlXsFnvt7O9rzLrfo88ci8PYfqQz4N4xJgdGfwU3YQKBgE6lctC4JyTzoFJpuPCAZgNdQApEICiTA3yf5vjKafY0gfITq2Zb/6F6eLqKM1EUDtInZA6AbNMoUElf4sJzI8xe5kdb6kdrPnBYONeCliJ0pxGF7ZCipHCHsS1mni6cX3cDy9DJ7AivuY5tfywyQDnCH7zL3Mxt9EmkvKa85uQdAoGBAMOJki5mEp1kZOsSv0cV8c0E+C4cXQTL6l4C5AG8n3GBrwUl4Ik9M5SHfbBjdrnuOjDARtbCnMkAXzBPufVnm3HJlZJL2B8dudol+5Ziej5MPFqWxsfI6Xykiih5NnrSRfgnuNGDjppWcMbmLcFHK3mmTDNmA6aTk6muIP18PFkF";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArffpkLY8TYxRxzKsF3YmAQyiJsa5URTvvI9wyfUUECJmCFMEgA9tyBH/AYNauLrIcd3K4EX7mli0pBPiQ6jLEy25jcWZ6FMhz5jl5eIiDmeh9PrljIbX44o8dfHeQTWSNAooNXHsVj/qoQCAqAHcU7+WLzm3dHHJoKGn+tyt88KbnmLkMWQKUj3Aikhxmrzl0NSVBuu9hCu4RVAakFHIs4yf34qjt6d9exC3s5Ve8YCPlmUynVTRoc6rLUFcqqwPOb3onKAEwyayfsFn89N89TyxzdOSBl1EvPQfK8zVicFN5AUSF6UXQ2UdKqv1+Y4gMrNFs/oyxH0shBCMIgC+HQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://43d7319j97.zicp.vip:31658/alipayCallback/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://43d7319j97.zicp.vip:31658/alipayCallback/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 日志打印路径
    public static String log_path = "D:\\logs\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

